<!DOCTYPE html>
<html>

	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta charset="UTF-8">
		<title>彩票</title>
		<link rel="stylesheet" type="text/css" href="__STATIC__/home/css/reset.css">
		<script src="__STATIC__/home/js/base.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="__STATIC__/home/css/aa.css" />
			<!--样式-->
		<style type="text/css">
			* {
				padding: 0;
				margin: 0;
			}
			
			img {
				vertical-align: top;
			}
			.wrapper{
				background: #ececec;
				overflow: hidden;
			}
			.top {
				width: 100%;
				height: 1.72rem;
				position: relative;
				border-bottom: 2px solid #e5e5e5;
				background: #FFFFFF;
			}
			
			.touxiang {
				position: absolute;
				width: 1.24rem;
				height: 1.24rem;
				border-radius: 50%;
				overflow: hidden;
				top: 0.24rem;
				left: 0.24rem;
			}
			
			.kuang {
				width: 1.24rem;
				height: 1.24rem;
			}
			
			.top-p {
				position: absolute;
				bottom: 0.24rem;
				left: 1.74rem;
				font-size: 0.32rem;
				color: #8d8d8d;
			}
			
			.top-div1 {
				width: 3.1rem;
				height: 0.58rem;
				background: #ef4532;
				color: #FFFFFF;
				/*box-shadow:0 0.05rem   rgba(239, 69, 50, 0.7);*/
				border-radius: 0.29rem;
				position: absolute;
				bottom: 0.2rem;
				right: 0.86rem;
			}
			
			.top-div2 {
				height: 0.58rem;
				color: #FFFFFF;
				line-height: 0.58rem;
				text-align: center;
				font-size: 0.3rem;
				position: absolute;
				left: 0;
				top: 0;
			}
			
			.top-div3 {
				font-size: 0.3rem;
				line-height: 0.58rem;
				text-align: center;
				height: 0.58rem;
				float: right;
			}
			
			.top-change {
				background: #F8CE2C;
				border-radius: 0.29rem;
				width: 54.8%;
			}
			
			.font-change {
				opacity: 0.4;
				width: 45.2%;
			}
			
			.wenhao {
				width: 0.5rem;
				height: 0.5rem;
				position: absolute;
				right: 0.2rem;
				bottom: 0.2rem;
			}
			.duobaoWra{
				width: 100%;
				height: 2.36rem;
				padding: 0.12rem;
				border-bottom: 0.02rem solid #E5E5E5;
				background: #FFFFFF;
			}
			.duobaowenzi{
				font-size: 0.26rem;
				color: #000000;
				opacity: 0.8;
			}
			.danwei{
				width: 100%;
				/*display: inline-block;*/
				height: 0.66rem;
				margin-top: 0.2rem;
			}
			.danwei>li{
				display: inline-block;
				font-size:0.3rem;
				color:#8D8D8D;
				margin-top: 0.1rem;
				margin-left: 0.75rem;
				vertical-align: top;
				margin-bottom: 0.24rem;
			}
			.number{
				width: 100%;
				/*padding-left: 0.0rem;*/
				margin-top: 0.1rem;
			}
			.number>li{
				vertical-align: top;
				display: inline-block;
				width: 0.86rem;
				height: 0.86rem;
				border-radius: 50%;
				background-image: url(__STATIC__/home/images/shuzijian.png);
				background-size: 100% 100%;
				font-size: 0.46rem;
				color:#FFFFFF;
				line-height: 0.86rem;
				text-align: center;
			}
			.number>li:nth-of-type(1){
				margin-left: 0.45rem;
				margin-right: 0.15rem;
			}
			.number>li:nth-of-type(2){
				margin-right: 0.20rem;
			}
			.number>li:nth-of-type(3){
				margin-right: 0.25rem;
			}
			.number>li:nth-of-type(4){
				margin-right: 0.25rem;
			}
			.number>li:nth-of-type(5){
				margin-right: 0.25rem;
			}
			.lunbo{
				width: 7rem;
				height: 4rem;
				margin: auto;
				margin: 0.24rem;
				border-radius: 0.05rem;
			}
			.addWrap {
				position: relative;
				width: 100%;
				background: #fff;
				margin: 0;
				padding: 0;
			}
			
			.addWrap .swipe {
				overflow: hidden;
				visibility: hidden;
				position: relative;
			}
			
			.addWrap .swipe-wrap {
				overflow: hidden;
				position: relative;
			}
			.addWrap .swipe-wrap>div {
				float: left;
				width: 100%;
				position: relative;
			}
			
			#position {
				position: absolute;
				bottom: 0;
				right: 0;
				padding-right: 0.08rem;
				margin: 0;
				background: rgba(0,0,0,0);
				/*opacity: 0;*/
				width: 100%;
				/*height: 0.2rem;*/
				filter: alpha(opacity=50);
				text-align: right;
			}
			#position li {
				width: 0.2rem;
				height: 0.2rem;
				margin:0 0.02rem;
				display: inline-block;
				-webkit-border-radius: 0.2rem;
				border-radius: 0.2rem;
				background-color: #AFAFAF;
			}
			#position li.cur {
				background-color: #FF0000;
			}
			
			.img-responsive {
				display: block;
				max-width: 100%;
				height: auto;
			}
			.jiluWra{
				width: 100%;
				background: #FFFFFF;
			}
			.jilutop{
				height: 0.86rem;
			
			}
			.jilutop>h3{
				vertical-align: top;
				display: inline-block;
				height: 0.86rem;
				line-height: 0.86rem;
				color:#585858;
				font-size: 0.4rem;
				margin-left: 1.78rem;
			}
			.jilutop>span{
				vertical-align:top;
				margin-top: 0.34rem;
				display: inline-block;
				font-size: 0.22rem;
				color:#FFFFFF;
				background: #fcd953;
				width: 1.58rem;
				height: 0.3rem;
				line-height: 0.3rem;
				text-align: center;
				border-radius: 0.14rem;
			}
			.shujuKuang{
				/*width: 4.37rem;*/
				height: 2.06rem;
				margin-left: 1.32rem;
				margin-top: 0.12rem;
				position: relative;
			}
			#news {
			height:100%;
			overflow: hidden;
		}
		#news li{
			font-size: 0.2rem;
			color:#a3a3a3;
		}
		.jianbian1{
			position: absolute;
			top: 0;
			width: 100%;
			height: 0.3rem;
			background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(255, 255, 255, 0.4) 60%, rgba(255, 255, 255, 0.2) 80%, rgba(255, 255, 255, 0) 100%); 
		}
		.jianbian2{
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 0.3rem;
			background-image: -webkit-linear-gradient(bottom, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 40%, rgba(255, 255, 255, 0.4) 60%, rgba(255, 255, 255, 0.2) 80%, rgba(255, 255, 255, 0) 100%); 
		}
		
		</style>
	</head>

	<body>
		<div class="wrapper">
			<div class="top">
				<div class="touxiang">
					<img src="__STATIC__/img/{$user.user_pic}" class="kuang" />
				</div>
				<p class="top-p">{$user.name}</p>
				<div class="top-div1">
					{empty name="Think.get.type"}
					<div class="top-div2 top-change">五分彩</div>
					<div class="top-div3 font-change"><a href="?type=1">十分彩</a></div>
					{else/}
					<div class="top-div2 font-change" style="background:;"><a href="index.html">五分彩</a></div>
					<div class="top-div3 top-change">十分彩</div>
					{/empty}
				</div>
				<img src="__STATIC__/home/images/shuoming.png" class="wenhao" />
			</div>
	
		<!--夺宝结果-->
		<div class="duobaoWra">
			<p class="duobaowenzi">
				<span>{$code.expect}</span>期夺宝结果
			</p>
			<ul class="danwei">
				<li>万</li>
				<li>千</li>
				<li>百</li>
				<li>十</li>
				<li>个</li>
			</ul>
			<!--数字列表-->
			<ul class="number">
				<li>{$code.opencode|substr=###,0,1}</li>
				<li>{$code.opencode|substr=###,2,1}</li>
				<li>{$code.opencode|substr=###,4,1}</li>
				<li>{$code.opencode|substr=###,6,1}</li>
				<li>{$code.opencode|substr=###,8,1}</li>
			</ul>
		</div>
	<!--图片轮播-->
	<div class="lunbo">
		<div class="addWrap">
			<div class="swipe" id="mySwipe">
				<div class="swipe-wrap">
					<div>
						<a href="javascript:;"><img class="img-responsive" src="__STATIC__/home/images/ka.png" /></a>
					</div>
					<div>
						<a href="javascript:;"><img class="img-responsive" src="__STATIC__/home/images/ka.png" /></a>
					</div>
					<div>
						<a href="javascript:;"><img class="img-responsive" src="__STATIC__/home/images/ka.png" /></a>
					</div>
				</div>
			</div>
			<ul id="position">
				<li class="cur"></li>
				<li></li>
				<li></li>
			</ul>
		</div>
	</div>
	<!--夺宝记录-->
	<div class="jiluWra">
		<div class="jilutop">
		<h3>夺宝记录</h3>
		<span>最近十期...</span>
		</div>
		<!--数据框-->
		<div class="shujuKuang">
			<div class="jianbian1"></div>
			<div class="jianbian2"></div>
			<div id="news">
			<ul>
				{volist name="bet" id="vo"}
				<li>
					<p style="width:75%;">
						<span style="width:45%;float:left;">{$vo.expect}&nbsp;&nbsp;期</span><span style="width:40%">{$vo.content}</span><span style="width:20%;float:right;">{$vo.number}注</span>
					</p>
				</li>
				{/volist}
			</ul>
		</div>
		</div>
	</div>
	<div class="bottomW"></div>
	</div>
	</body>

</html>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="__STATIC__/home/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>

<script src='__STATIC__/home/js/hhSwipe.js' type="text/javascript"></script>
<script type="text/javascript">
	//引用底部栏
	$(".bottomW").load("{:url('index/bottom')}")
	//轮播图
	var bullets = document.getElementById('position').getElementsByTagName('li');
	var banner = Swipe(document.getElementById('mySwipe'), {
		auto: 4000,
		continuous: true,
		disableScroll: false,
		callback: function(pos) {
			var i = bullets.length;
			while(i--) {
				bullets[i].className = ' ';
			}
			bullets[pos].className = 'cur';
		}
	})
	
	//数据轮播
	$(function() {
		var $this = $("#news");
		var scrollTimer;
		$this.hover(function() {
			clearInterval(scrollTimer);
		}, function() {
			scrollTimer = setInterval(function() {
				scrollNews($this);
			}, 1000);
		}).trigger("mouseleave");
		function scrollNews(obj) {
			var $self = obj.find("ul");
			var lineHeight = $self.find("li:first").height();
			$self.animate({
				"marginTop": -lineHeight + "px"
			}, 800, function() {
				$self.css({
					marginTop: 0
				}).find("li:first").appendTo($self);
			})
		}
	})
		/*http://cp.pf09.top/home/index/index*/
	/*获取登录信息*/
	function getCookie(cname){
	  var name = cname + "=";
	  var ca = document.cookie.split(';');
	  for(var i=0; i<ca.length; i++) 
	  {
	    var c = ca[i].trim();
	    if (c.indexOf(name)==0) return c.substring(name.length,c.length);
	  }
	  return "";
	}
	function getInfo() {
		let token = getCookie('login')
		console.log(token)
		console.log(document.cookie);
		$.ajax({
			url: 'http://cp.pf09.top/home/index/index',
			type:"POST",
			data: {
				token:token
			},
			// xhrFields: {
   //        withCredentials: true
   //     },
       // crossDomain: true,
		})
		.done(function(res) {
			console.log(res)
			console.log("success");
		})
		.fail(function() {
			console.log("error");
		})
		.always(function() {
			console.log("complete");
		});
	}
	getInfo()
	$.ajaxSetup({
	  type: 'POST',
	  complete: function(xhr,status) {
	    var sessionStatus = xhr.getResponseHeader('sessionstatus');
	    console.log(sessionStatus)
	    if(sessionStatus == 'timeout') {
	      var top = getTopWinow();
	      var yes = confirm('由于您长时间没有操作, session已过期, 请重新登录.');
	      if (yes) {
	        top.location.href = '/skynk/index.html';      
	      }
	    }
	  }
	});	
</script>